CONDITIONALS: Using conditionals in a program makes it so that some code runs only if a condition is met.

An if statement defines a block of code that will only run when a condition is met.

  • Click Run and enter a password when prompted. Did you get it right?
  • The conditional here is checking that the value stored in user_input is the same as "#1PythonCoder".
  • Click Submit and Next to move on.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)